// src/utils/constants.ts
import { Platform } from 'react-native';

// API配置
export const API_BASE_URL = __DEV__ ? 'http://192.168.0.13:5700/apis' : 'https://api.aitool.app';

export const API_TIMEOUT = 30000;

// WebSocket配置
export const WS_BASE_URL = __DEV__ ? 'ws://192.168.0.13:5700/apis' : 'wss://api.aitool.app';

// 存储键
export const STORAGE_KEYS = {
  TOKEN: 'token',
  REFRESH_TOKEN: 'refreshToken',
  USER: 'user',
  SETTINGS: 'settings',
  LANGUAGE: 'language',
  THEME: 'theme',
  DEVICE_INFO: 'deviceInfo',
  CHAT_HISTORY: 'chat_history',
  TRANSLATION_HISTORY: 'translation_history',
  VOICE_HISTORY: 'voice_history',
};

// 应用配置
export const APP_CONFIG = {
  VERSION: '1.0.0',
  BUILD: '1',
  NAME: 'AI工具箱',
  BUNDLE_ID: Platform.select({
    ios: 'com.aitool.app',
    android: 'com.aitool.app',
  }),
};

// 限制配置
export const LIMITS = {
  FREE: {
    DAILY_CHAT: 10,
    DAILY_TRANSLATION: 20,
    DAILY_VOICE: 5,
    MAX_TOKENS: 500,
  },
  BASIC: {
    DAILY_CHAT: 100,
    DAILY_TRANSLATION: 200,
    DAILY_VOICE: 50,
    MAX_TOKENS: 1000,
  },
  PREMIUM: {
    DAILY_CHAT: 1000,
    DAILY_TRANSLATION: 2000,
    DAILY_VOICE: 500,
    MAX_TOKENS: 2000,
  },
};

// 支持的语言
export const SUPPORTED_LANGUAGES = [
  { code: 'zh-CN', name: '简体中文', flag: '🇨🇳' },
  { code: 'zh-TW', name: '繁體中文', flag: '🇹🇼' },
  { code: 'en', name: 'English', flag: '🇺🇸' },
  { code: 'ja', name: '日本語', flag: '🇯🇵' },
  { code: 'ko', name: '한국어', flag: '🇰🇷' },
  { code: 'fr', name: 'Français', flag: '🇫🇷' },
  { code: 'de', name: 'Deutsch', flag: '🇩🇪' },
  { code: 'es', name: 'Español', flag: '🇪🇸' },
  { code: 'ru', name: 'Русский', flag: '🇷🇺' },
  { code: 'ar', name: 'العربية', flag: '🇸🇦' },
];

// 主题配置
export const THEMES = {
  light: {
    primary: '#667eea',
    secondary: '#764ba2',
    background: '#ffffff',
    surface: '#f8f9fa',
    text: '#333333',
    textSecondary: '#666666',
    border: '#e0e0e0',
    error: '#ff6b6b',
    success: '#4caf50',
    warning: '#ffa500',
    info: '#2196f3',
  },
  dark: {
    primary: '#667eea',
    secondary: '#764ba2',
    background: '#1a1a1a',
    surface: '#2a2a2a',
    text: '#ffffff',
    textSecondary: '#cccccc',
    border: '#444444',
    error: '#ff6b6b',
    success: '#4caf50',
    warning: '#ffa500',
    info: '#2196f3',
  },
};